How do I study?
- Notes + Lecture slides
- Book 
- Practice
- Take advantage of the office hours

- Second Java program: Surface area of a cricle --- CircleArea.java

Programs take input and produce an output. 
We need to create variables for input and output

Logical section 1: Introduce the variables
Input? Output?
Input: radius 
Constant: pi
Output: surface

Logical section 2: Business logic
Formula: arithmetic expressions

Logical section 3: Producing an output
System.out.print
Let us display the radius value + the area value

- Repeating yourself is a code smell
Removing the code smells ===> Refactoring the code

- 8 primitive data types by Java
integers: byte, short, int, long
floating point values: float, double
Character: char
boolean: true or false

Single bit: 0 or 1 ---> 2 values
2 bits together: 
0	0
0	1
1	0
1	1

4 values for 2 bits

n bits ==> 2^n values

8 bits ===> 2^8 = 256 values

Recommendation: use int for integer values, and double for floating point values

FloatDemo.java

23.5 // literal decimal value ---> double ==> to turn it into a float: 23.5f or 23.5F

23 // By default they are int ---> int converted to long: 23l or 23L

- Characters: 
Unicode character set ---> 16 bits: 65,000 characters

'0' < '1' <...< '9'	'A' < 'B' < ... < 'Z'	'a' < 'b' .... <'z'
48     49	57 	65    66	   90	97		122

- boolean: true or false

- Modulo operator: 
a % b  = if a < b

if a = k*b + remainder and I do a % b = remainder
17 = 4*4 + 1 => 17 % 4 = 1

14 + 4 / 2 ---> If + is performed first, the answer is 9
If / goes first, answer = 16

14 + 4 = 18
14 + 4.0 = 18.0

15 / 2 = 7

- Same variable may appear on both sides of an assignment statement: 

int value = 2;

value = value + 1; // value += 1;

System.out.println("Value: " + value);

int a = 2;
value = value + a;









 




















